/**
 * https://leetcode-cn.com/problems/maximum-nesting-depth-of-the-parentheses/
 * @param {string} s
 * @return {number}
 */
var maxDepth = function(s) {
  let depth = 0
  let result = 0
  for(let i = 0;i< s.length;i++){
    if(s[i] === '('){
      depth ++
    }
    if(s[i] === ')'){
      depth --
    }
    result = Math.max(result,depth)
  }
  return result
};
